package com.snline.crm.logistics.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.snline.crm.logistics.dao.inter.ITrackMapper;
import com.snline.crm.logistics.entity.ProjectInfo;
import com.snline.crm.logistics.entity.ProjectTrack;
import com.snline.crm.logistics.entity.ProjectUserInfo;

/**
 * 进度信息
 * @author sxy
 *
 */
@Service("trackService")
public class TrackService{

	@Resource
	private ITrackMapper trackMapper;


    /**
     * 得到指定数据
     * @param trackId
     * @return
     */
    public ProjectTrack selectTrack(String trackId){
        
        return trackMapper.selectTrack(trackId);
    }
    
    /**
     * 进度信息
     * @param userId 用户ID
     * @return 进度信息
     */
    public List<ProjectTrack> selectProjectTrack(String userId){
        
        return trackMapper.selectProjectTrack(userId);
    }
    

    /**
     * 进度信息
     * @param userId 用户ID
     * @param statusFlg 状态
     * @return 进度信息
     */
    public List<ProjectTrack> selectProjectTrackStats(String userId, String statusFlg, int page){
        
        return trackMapper.selectProjectTrackStats(userId,statusFlg, page);
    }
    
    /**
     * 项目的插入
     * @param projectTrack 项目插入内容
     * @return
     */
    public int insert(ProjectTrack projectTrack){
        
        return trackMapper.insert(projectTrack);
    }
    
    /**
     * 进度的百分比和时间的修改
     * @param projectTrack
     * @return
     */
    public int UpdateTrack(ProjectTrack projectTrack){
        
        return trackMapper.UpdateTrack(projectTrack);
    }
    
    /**
     * 手动消除此类内荣
     * @param trackId
     * @return
     */
    public int delTrack(String trackId){
        
        return trackMapper.delTrack(trackId);
    }
    

    /**
     * 负责人修改进度
     * @param projectTrack
     * @return
     */
    public int updateByAdmin (ProjectTrack projectTrack){
        
        return trackMapper.updateByAdmin(projectTrack);
    }
    

    /**
     * 取得所有的项目名称
     * @return
     */
    public List<ProjectInfo> selectProjectInfos(){
        
        return trackMapper.selectProjectInfos();
    }
    
    /**
     * 取得所有的用户名称
     * @return
     */
    public List<ProjectUserInfo> selectProjectUserInfos(){
        
        return trackMapper.selectProjectUserInfos();
    }

}
